<?php

function get_remote_image($url, $savepath) {
    ob_start();
    readfile($url);
    $img = ob_get_contents();
    ob_end_clean();
    $size = strlen($img);
    $fp2 = @fopen($savepath, "a");
    fwrite($fp2, $img);
    fclose($fp2);
    return $savepath;
}

?>
